﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Network
{
    class Network
    {

        FinalNeural final;
        HiddenNeural[] hidden;
        double error;

        public Network(int nbNeurone)
        {
            hidden = new HiddenNeural[nbNeurone];

            for (int i = 0; i < nbNeurone;i++ )
            {
                hidden[i] = new HiddenNeural();
            }
            
            final = new FinalNeural(nbNeurone);
        }

        public HiddenNeural[] getHiddenNeuronal()
        {
            return this.hidden;
        }

        public FinalNeural getFinalNeuronal()
        {
            return this.final;
        }

        public void setError(double err)
        {
            this.error = err;
        }

        public void errorPlus(double r)
        {
            this.error += r;
        }

        public double getError()
        {
            return this.error;
        }

      /*  public double Survive(int _age, int _annee, int _ganglion, Network r)
        {
            Network temp = r;
            double[] output = new double[Program.NombreNeurones];
            for (int i = 0; i < Program.NombreNeurones; i++)
            {
                temp.getHiddenNeuronal()[i].setInputValue(_age, _annee, _ganglion);
                double pot = temp.getHiddenNeuronal()[i].getPotential();
                output[i] = temp.getHiddenNeuronal()[i].getOutput(pot);
            }
            temp.getFinalNeuronal().setValueInput(output);
            double Finalpot = temp.getFinalNeuronal().getPotential();
            double res = temp.getFinalNeuronal().getOutput(Finalpot);


            //  r.getFinalNeuronal().findError(int.Parse(input[3]));
            //  r.setError(r[line_number].getFinalNeuronal().getFinalError());

            double sortie = Math.Round(res, 2);
            return sortie;
        }*/


     /*   public double FinddError()
        {

            double err = 100 * (1/Program.NombreNeurones)*
        }*/
    }
}
